package com.study.designpatterns;

class Food {
    String name;
    String spicy;
    String condiment;

    public void addCondiment(String condiment) {
        this.condiment = condiment;
    }

    public void addSpicy(String spicy) {
        this.spicy = spicy;
    }
}

class LanZhouNoodle extends Food {


}

class HuangMenChicken extends Food {

}

public class SimpleFactory {
    public static Food makeFood(String name) {
        if ("noodle".equals(name)) {
            Food noodle = new LanZhouNoodle();
            noodle.addSpicy("more");
            return noodle;
        } else if ("chicken".equals(name)) {
            Food chicken = new HuangMenChicken();
            chicken.addCondiment("potato");
            return chicken;
        } else {
            return null;
        }
    }
}
